<?php
function getTbdLisA ($showArr, $nextRateBar)
{
    $tbdList = "";
    $i = 0;
    foreach ($showArr as $key => $val)
    {
        ++$i;
        $tbdList .= "<tr id=\"rqr_tr" . $key . "\">" . "<th class=\"rqr_th\" width=\"72\">" . $val . "</th>" . "<td><div id=\"rqr_r" . $key . "\"></div><br /><div id=\"rqr_r" . $key . "radio\"></div></td>" . "</tr>";
        if ($i % $nextRateBar == 0)
        {
            $tbdList .= "<tr>" . ( "<th class=\"rqr_th\">新赔率</th>" ) . "<td><div id=\"rqr_r" . $key . "select\"></div></td>" . "</tr>";
        }
    }
    return $tbdList;
}

if (!defined("IN_OP"))
{
    exit("You can't access this file directly...");
}
if ($curruser['acl'] != 255 && $curruser['acl'] != 300)
{
    exit();
}
else if ($curruser['prev_id'] != 0)
{
    exit();
}
require_once( "class_3d/CheckMode_3d.php" );
$gametype = intval(getvar("gametype"));
$chk = new CheckMode_3d($curruser['acl'], 3, $gametype);
$chk->checkShow3dPage();
$show3D3S = $chk->show3D3S;
$show5N = getShow35($gametype);
unset($chk);
$tbl = $g_gametype_3d[$gametype]['en'];
$tblName = $g_gametype_3d[$gametype]['ch'];
require_once( "class_3d/RateConfig_3d.php" );
$RateConfig_3d = new RateConfig_3d($gametype);
$ui = new UI_3D(true);
$tpl = new Template2();
$conf = new Config();
$playType = getvar("pagename");
$subIDQ = getvar("subIDQ");
$subIDQ = $subIDQ == "" ? false : intval($subIDQ);
$showSubid = getvar("showSubid");
$showSubid = isset($RateConfig_3d->subArr[$showSubid]) ? $showSubid : "0";
if (!isset($RateConfig_3d->playtypeArr02[$playType]))
{
    exit();
}
else if ($subIDQ !== false && !in_array($subIDQ, $RateConfig_3d->playGroupArr02[$playType]))
{
    exit();
}
$tbdList = "";
$showArr = array();
$tblType = "";
if ($show5N)
{
    $littleTitle = $RateConfig_3d->subArr[$showSubid];
}
else
{
    $littleTitle = "";
}
switch ($playType)
{
    case "r1" :
        $showArr['0'] = "一字组合&nbsp;&nbsp;项目";
        $nextRateBar = 1;
        $tblType = 1;
        break;
    case "r1p" :
        $showArr['0'] = "一字组合&nbsp;&nbsp;项目";
        $showArr['1'] = "佰定位&nbsp;&nbsp;项目";
        $showArr['2'] = "拾定位&nbsp;&nbsp;项目";
        $showArr['3'] = "个定位&nbsp;&nbsp;项目";
        $nextRateBar = 1;
        $tblType = 1;
        break;
    case "r2p" :
        $subIDQ = $subIDQ ? $subIDQ : 14;
        $tempArr = array("14" => array("佰", "拾"), "15" => array("佰", "个"), "16" => array("拾", "个"));
        $showArr["{$subIDQ}_p2"] = $tempArr[$subIDQ][0];
        $showArr["{$subIDQ}_p1"] = $tempArr[$subIDQ][1];
        $nextRateBar = 2;
        $tblType = 1;
        break;
    case "r2" :
        $tbdList = "";
        break;
    case "r2a" :
        $subIDQ = $subIDQ ? $subIDQ : 36;
        $tempArr = array("36" => "佰拾", "37" => "佰个", "38" => "拾个");
        $subIDQ2 = $subIDQ + 3;
        $showArr[$subIDQ] = $tempArr[$subIDQ] . "和数&nbsp;&nbsp;项目";
        $showArr[$subIDQ2] = $tempArr[$subIDQ] . "和数尾数&nbsp;&nbsp;项目";
        $nextRateBar = 1;
        $tblType = 1;
        break;
    case "r3p" :
        $showArr['21_p3'] = "佰";
        $showArr['21_p2'] = "拾";
        $showArr['21_p1'] = "个";
        $nextRateBar = 3;
        $tblType = 1;
        break;
    case "r3" :
        $showArr['20_p3'] = "佰";
        $showArr['20_p2'] = "拾";
        $showArr['20_p1'] = "个";
        $nextRateBar = 3;
        $tblType = 1;
        break;
    case "r3a" :
        $showArr['42'] = "佰拾个和数&nbsp;&nbsp;项目";
        $showArr['43'] = "佰拾个和数尾数&nbsp;&nbsp;项目";
        $nextRateBar = 1;
        $tblType = 1;
        break;
    case "rcmp" :
        $showArr['35_p3'] = "佰";
        $showArr['35_p2'] = "拾";
        $showArr['35_p1'] = "个";
        $nextRateBar = 3;
        $tblType = 1;
        break;
    case "r1bs" :
        $showArr['47'] = "跨度&nbsp;&nbsp;项目";
        $nextRateBar = 1;
        $tblType = 1;
        break;
}
switch ($tblType)
{
    case 1 :
        $tbdList = getTbdLisA($showArr, $nextRateBar);
        $tdcolspan = "2";
        break;
    case 2 :
        $tdcolspan = "3";
        break;
    default :
        $tdcolspan = "11";
        break;
}
$tpl->load("main", "rateQuickRecord_3d.htm");
if ($g_conf['language'] != "zh-cn")
{
    header("Content-Type: text/html; charset=utf-8");
}
else
{
    header("Content-Type: text/html; charset=gb2312");
}
$tpl->set(array("playType" => $playType, "pageTitle" => $littleTitle . " @ " . $RateConfig_3d->playtypeArr02[$playType], "tbdList" => $tbdList, "subIDQ" => $subIDQ === false ? "" : $subIDQ, "tdcolspan" => $tdcolspan));
$tpl->show("main");
?>